home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_edit.arc / WORLD.C < prev   
C/C++ Source or Header  |  1991-09-08  |  1KB  |  64 lines

  1. /*                                                                            */
  2. /*      EGA Graphic Primitive for Microsoft C 3.00, Version 01MAR86.          */
  3. /*      (C) 1986 by Kent Cedola, 2015 Meadow Lake Ct., Norfolk, VA, 23518     */
  4. /*                                                                            */
  5. /*      Description: This an example of how graphic primitives can be put     */
  6. /*      together to form 'HIGH LEVEL' graphic routines.                       */
  7. /*                                                                            */
  8.  
  9. #include <mcega.h>
  10.  
  11. void SetViewport(x1,y1,x2,y2)
  12.   int  x1,y1,x2,y2;
  13. {
  14.   GPViewport(x1,y1,x2,y2);
  15. }
  16.  
  17. void SetWindow(x1,y1,x2,y2)
  18.   int  x1,y1,x2,y2;
  19. {
  20.   GPWindow(x1,y1,x2,y2);
  21. }
  22.  
  23. void MovAbs(x,y)
  24.   int x,y;
  25. {
  26.   GDCURX1 = x;
  27.   GDCURY1 = y;
  28. }
  29.  
  30. void MovRel(x,y)
  31.   int x,y;
  32. {
  33.   GDCURX1 = GDCURX1 + x;
  34.   GDCURY1 = GDCURY1 + y;
  35. }
  36.  
  37. void LnAbs(x2,y2)
  38.   int x2,y2;
  39. {
  40.   int x1,y1;
  41.  
  42.   register i;
  43.  
  44.   x1 = GDCURX1;
  45.   y1 = GDCURY1;
  46.   GDCURX1 = x2;
  47.   GDCURY1 = y2;
  48.  
  49.   if (GPCLIP2(&x1,&y1,&x2,&y2) != 2)
  50.     {
  51.     GPSCALE(&x1,&y1);
  52.     GPMOVE(x1,y1);
  53.     GPSCALE(&x2,&y2);
  54.     GPLINE(x2,y2);
  55.     };
  56.  
  57. }
  58.  
  59. void LnRel(x,y)
  60.   int x,y;
  61. {
  62.   LnAbs(GDCURX1 + x, GDCURY1 + y);
  63. }
  64.